Skip to content
This repository was archived by the owner on Jun 25, 2026. It is now read-only.

Fix Integration: Recognize clicks from components that use href-to (ember-paper)#43

Closed
openhouse wants to merge 1 commit into
intercom:masterfrom
openhouse:recognize-clicks-from-other-components
Closed

Fix Integration: Recognize clicks from components that use href-to (ember-paper)#43
openhouse wants to merge 1 commit into
intercom:masterfrom
openhouse:recognize-clicks-from-other-components

Conversation

@openhouse

Copy link
Copy Markdown

I want to use href-to with a component from https://github.com/miguelcobain/ember-paper that renders an anchor element.

{{#paper-button href=(href-to "settings") class="href-to"}}Settings{{/paper-button}}

I am able to use the href-to helper to set the href attribute on the component, which renders as expected. Great!

<a id="ember736" tabindex="0" href="/settings" class="href-to ember-view paper-button md-default-theme md-button md-ink-ripple">  Settings
<div class="md-ripple-container"></div></a>

But with this, href-to didn't recognize when I clicked the link. I got the hard native browser redirect rather than a nice Ember router transition. It was because every component's element gets the .ember-view class which didn't fit the conditions in href-to's initializer.

So I made this pull request to update the initializer. Now href-to recognizes and smoothly transitions clicks on anchor elements when they have the .href-to class even if they are components.

To stay out of the way, href-to continues to not intervene when there is an action set on an element.

… a route transition on click as long as the element doesn't have an ember action.
@patocallaghan

Copy link
Copy Markdown
Member

The ember-href-to package is now maintained by the Ember community and lives at https://github.com/adopted-ember-addons/ember-href-to. We're closing this PR and archiving this repo. If you still think it's relevant, please reopen it against the new repo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants